spb/datacenterindex
Public
HTML 53.9%
TypeScript 44.5%
JavaScript 0.6%
SQL 0.5%
1import { api } from "@/lib/api";2import { fmtInt } from "@/lib/format";3import { OG_CONTENT_TYPE, OG_SIZE, renderOg } from "@/lib/og-template";4import { SCOPE_LABEL, fmtRankValue } from "../ranking-format";56export const alt = "DataCenterIndex ranking";7export const size = OG_SIZE;8export const contentType = OG_CONTENT_TYPE;9export const revalidate = 3600;1011export default async function Image({ params }: { params: Promise<{ key: string }> }) {12 const { key } = await params;13 const r = await api.ranking(key, { limit: 3 });14 if (!r.ok) return renderOg({ eyebrow: "Ranking", title: "DataCenterIndex rankings", subtitle: "Countries, markets and operators ranked by facilities, capacity and pipeline." });15 const d = r.data;16 const rows = d.rows ?? [];17 const stats = rows.length ? rows.slice(0, 3).map((row) => ({ label: `#${row.rank} ${row.name}`.slice(0, 28), value: fmtRankValue(row.value, d.unit) })) : [{ label: "Entities ranked", value: fmtInt(d.total) }];18 return renderOg({ eyebrow: "Ranking", title: d.label, subtitle: `${SCOPE_LABEL[d.scope]} · ${d.unit}`, stats });19}20